package jp.co.menox.controller.tmapp.lend;

import jp.co.menox.tmcommon.model.Status;
import jp.co.menox.tmserver.service.StatusService;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

public class AddStatusController extends Controller {

    @Override
    public Navigation run() throws Exception {
        // テスト用データ
        put(0, "未承認");
        put(1, "承認済");
        put(2, "貸出中");
        put(3, "返却済");
        put(4, "キャンセル");
        put(5, "申請却下");
        put(9, "その他");
        
        return null;
    }
    
    public void put(int type, String name) {
        
        Status status = new Status();
        status.setType(type);
        status.setName(name);
        
        new StatusService().insert(status);
    }
}